<!DOCTYPE html>
<?php
    require('../_app/Config.inc.php');

    session_start();
?>
<html lang="pt-br">
    <head>
        <meta charset="UTF-8">
        <title>SVOnline - Login</title>
        <link rel="stylesheet" href="css/reset.css" />
        <link rel="stylesheet" href="css/admin.css" />
    </head>
    <body>

        <div id="login">
            <div class="boxin">
                <!-- <h1>Administrar site</h1> -->
                <h1>Acessar e-mail</h1>

                <?php

                   $login = new Login(3);

                    $dataLogin = filter_input_array(INPUT_POST, FILTER_DEFAULT);
                    if(!empty($dataLogin['AdminLogin'])):
                        $login->ExeLogin($dataLogin);
                        if(!$login->getResult()):
                            WSErro($login->getError()[0], $login->getError()[1]);
                        else:
                            header('Location:http://localhost/ProjetoFaculdade/SVOnline/admin/painel.php');
                        endif;
                    endif;

                ?>

                <form name="AdminLoginForm" action="" method="POST">
                    <label>
                        <span>E-mail:</span><br />
                        <input type="email" name="user" />
                    </label>

                    <label>
                        <br /><span>Senha:</span><br />
                        <input type="password" name="pass" /><br />
                    </label>

                    <input type="submit" name="AdminLogin" value="Logar" />

                </form>
            </div>
        </div>
    </body>
</html>